﻿@{
    ViewBag.Title = "Common Command";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
        <ol class="breadcrumb">
            <li><a href="/Home.html">Home</a></li>
            <li><a href="/WebApp/WebApi"> Sanelib WebApp</a></li>
            <li class="active">BackUp</li>
        </ol>
      
            <div id="introduction">
                <h1 class="text-left">Backup the Folders & Files  from the directory and subdirectory</h1>
            </div>
            <div>
                <p>
                    Here first of all files and folder and it’s all subdirectory compressed and stored in to the different location as a backup
                </p>
            </div>
            <div id="Example">
                <h3>Example :</h3>
                <p>so, will start to This Directory Will be Compressed and Backup into the different storage space</p>
                <div class="divcolor">
                    <pre><code>.\important\files\*.ps1</code></pre>
                </div>

                <p>-	First of all set the directory in one variable which are compressed</p>
                <div class="divcolor">
                    <pre><code>$bkfile = ".\important\files"</code></pre>
                </div>

                <p>-	And After the destination path where the compressed files are stored</p>
                <div class="divcolor">
                    <pre><code>$destination = ".\Backup\Archive.zip"</code></pre>
                </div>

                <p>Here, Archive.zip is name of the file to which are saved in backup folder</p>

                <p>-    After set the destination then the set the 7za.exe path whose describe the methods for the zip, unzipped file and more options are available</p>
                <p>-	7zip are also download from this <a href="http://www.7-zip.org/download.html" style="color: blue;">link</a> </p>
                <p>-	Here, 7za.exe provides the different commands and switches operation</p>

                <img src="~/Images/Wps/WPS_Backup.png" alt="Commands and switches which are used to compressed and diff. thing" />
                <p>set the path of 7za.exe package used for the compressed files and folder</p>
                <div class="divcolor">
                    <pre><code>$zip = ".\Source Control\trunk\tools\7zip\7za.exe";</code></pre>
                </div>

                <p>-	Then the set the arguments for the compression and all of others operation</p>
                <div class="divcolor">
                    <pre><code>[array]$args = @("a" , "-tzip" , "-y" ,$destination)+$bkfile;</code></pre>
                </div>

                <p>-	After the execute $zip with the arguments</p>
                <div class="divcolor">
                    <pre><code>& $zip $args;</code></pre>
                </div>
                <p>and the output of the backup scripts</p>

                <img src="~/Images/Wps/WPS_Backup1.png" alt="output of the backup file" />
       </div>